package cmd

import (
	"fmt"
	"learning/gooop/saga/mqs/config"
	_ "learning/gooop/saga/mqs/delivery"
	"learning/gooop/saga/mqs/eventbus"
	"learning/gooop/saga/mqs/models/events"
	"learning/gooop/saga/mqs/routers"
)

func BootMQS() {
	eventbus.GlobalEventBus.Pub(events.SystemBootEvent, nil)

	router := routers.RegisterRouters()
	router.Run(fmt.Sprintf(":%d", config.GetPort()))
}